meson: check for more missing config.h defines
authorTim-Philipp Müller <tim@centricular.com>
Thu, 23 Mar 2017 20:50:03 +0000 (20:50 +0000)
committerEmmanuele Bassi <ebassi@gnome.org>
Wed, 3 May 2017 14:10:55 +0000 (15:10 +0100)
Lots of them are unused and can be removed. For others we
add a check.

config.h.meson
gtk/meson.build
meson.build

index 65d7e09b088eb29d97f535d4a6e31ca53536ebda..1200bd0eb79c8aad54bdfdf6108a83f53a6ba806 100644 (file)
 /* Define to 1 if you have the `getresuid' function. */
 #mesondefine HAVE_GETRESUID
 
-/* Define if the GNU gettext() function is already present or preinstalled. */
-#mesondefine HAVE_GETTEXT
-
 /* Define if gio-unix is available */
 #mesondefine HAVE_GIO_UNIX
 
-/* Have GNU ftw */
-#mesondefine HAVE_GNU_FTW
-
 /* Define to 1 if you have the `httpGetAuthString' function. */
 #mesondefine HAVE_HTTPGETAUTHSTRING
 
 /* Define to 1 if the system has the type `IPrintDialogCallback'. */
 #mesondefine HAVE_IPRINTDIALOGCALLBACK
 
-/* Define if your <locale.h> file defines LC_MESSAGES. */
-#mesondefine HAVE_LC_MESSAGES
-
 /* Define to 1 if you have the <locale.h> header file. */
 #mesondefine HAVE_LOCALE_H
 
-/* Define to 1 if you have the `localtime_r' function. */
-#mesondefine HAVE_LOCALTIME_R
-
 /* Define to 1 if you have the `lstat' function. */
 #mesondefine HAVE_LSTAT
 
 /* Define to 1 if you ahve the `exp2` function */
 #mesondefine HAVE_EXP2
 
-/* Have the sockaddr_un.sun_len member */
-#mesondefine HAVE_SOCKADDR_UN_SUN_LEN
-
-/* Define to 1 if solaris xinerama is available */
-#mesondefine HAVE_SOLARIS_XINERAMA
-
 /* Define to 1 if you have the <stdint.h> header file. */
 #mesondefine HAVE_STDINT_H
 
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #mesondefine HAVE_SYS_STAT_H
 
-/* Define to 1 if sys/sysinfo.h is available */
-#mesondefine HAVE_SYS_SYSINFO_H
-
-/* Define to 1 if sys/systeminfo.h is available */
-#mesondefine HAVE_SYS_SYSTEMINFO_H
-
 /* Define to 1 if you have the <sys/time.h> header file. */
 #mesondefine HAVE_SYS_TIME_H
 
 /* Have XGenericEvent */
 #mesondefine HAVE_XGENERICEVENTS
 
-/* Define to 1 if xinerama is available */
-#mesondefine HAVE_XINERAMA
-
 /* Define to use XKB extension */
 #mesondefine HAVE_XKB
 
 /* Define if _NL_TIME_FIRST_WEEKDAY is available */
 #mesondefine HAVE__NL_TIME_FIRST_WEEKDAY
 
-/* Define to 1 if you have the `_NSGetEnviron' function. */
-#mesondefine HAVE__NSGETENVIRON
-
 /* Define to the sub-directory where libtool stores uninstalled libraries. */
 #mesondefine LT_OBJDIR
 
index 55c921a6b525d8ab872de18431cc4c08a92e9335..5c33f77d9665f4ae0c3aedd448d1ac6d81f19b74 100644 (file)
@@ -829,6 +829,25 @@ endif
 # org.gtk.Settings.Debug.gschema.xml
 gnome.compile_schemas()
 
+# Check for more things
+
+if cc.has_header('langinfo.h')
+  foreach nl_enum : [ '_NL_MEASUREMENT_MEASUREMENT',
+                      '_NL_PAPER_HEIGHT',
+                      '_NL_PAPER_WIDTH',
+                      '_NL_TIME_FIRST_WEEKDAY' ]
+    cdata.set('HAVE_' + nl_enum, cc.has_header_symbol('langinfo.h', nl_enum))
+  endforeach
+endif
+
+# check token HAVE__NL_MEASUREMENT_MEASUREMENT
+# check token HAVE__NL_PAPER_HEIGHT
+# check token HAVE__NL_PAPER_WIDTH
+# check token HAVE__NL_TIME_FIRST_WEEKDAY
+
+
+# Library
+
 libgtk = shared_library('gtk-4',
   sources: [typefuncs, gtk_sources, gtkmarshal_h, gtkprivatetypebuiltins_h],
   c_args: gtk_cargs,
index 9afb89bef032ebb72c7fca971a209682daf908c1..335cffb68728a0d9b75afcb9a0c7522ec76a00e2 100644 (file)
@@ -122,25 +122,7 @@ endforeach
 # Maths functions might be implemented in libm
 libm = cc.find_library('m', required : false)
 
-# check token HAVE_BIND_TEXTDOMAIN_CODESET
-# check token HAVE_CUPS_API_1_6
-# check token HAVE_GETTEXT
-# check token HAVE_GIO_UNIX
-# check token HAVE_GNU_FTW
-# check token HAVE_HTTPGETAUTHSTRING
-# check token HAVE_HTTP_AUTHSTRING
-# check token HAVE_IPRINTDIALOGCALLBACK
-# check token HAVE_LC_MESSAGES
-# check token HAVE_LOCALTIME_R
-# check token HAVE_SOCKADDR_UN_SUN_LEN
-# check token HAVE_SOLARIS_XINERAMA
-# check token HAVE_XFREE_XINERAMA
-# check token HAVE_XINERAMA
-# check token HAVE__NL_MEASUREMENT_MEASUREMENT
-# check token HAVE__NL_PAPER_HEIGHT
-# check token HAVE__NL_PAPER_WIDTH
-# check token HAVE__NL_TIME_FIRST_WEEKDAY
-# check token HAVE__NSGETENVIRON
+# FIXME: HAVE_XFREE_XINERAMA
 
 check_functions = [
   'dcgettext',
@@ -330,6 +312,11 @@ endif
 
 mlib = cc.find_library('m', required: false)
 
+# Check for bind_textdomain_codeset, including -lintl if GLib brings it in
+if cc.has_function('bind_textdomain_codeset', dependencies: glib_dep)
+  cdata.set('HAVE_BIND_TEXTDOMAIN_CODESET', 1)
+endif
+
 cdata.set('HAVE_GIO_UNIX', giounix_dep.found())
 
 # Check for Vulkan support